19. Hardware Related Commands > 19.2 AT+CALA   Set alarm time

19.2
AT+CALA   Set alarm time
The AT+CALA write command can be used to set an alarm time in the ME or to clear a programmed alarm. When the alarm time is reached and the alarm is executed the ME returns an Unsolicited Result Code (URC) and the alarm time is reset to "00/01/01,00:00:00".
The alarm can adopt two functions, depending on whether or not you switch the GSM engine off after setting the alarm:
•
Reminder message: You can use the alarm function to generate reminder messages. For this purpose, set the alarm as described below and do not switch off or power down the ME. When executed the message comes as an Unsolicited Result Code which reads "+CALA".
•
Airplane mode: The alarm function can be used to wake up the ME at a scheduled time. For this purpose, set the alarm as described below. Then power down the ME by entering the AT^SMSO command. When the alarm time is reached the ME enters the Airplane mode, notified to the user by the URC "^SYSSTART AIRPLANE MODE" and, if available, by a user defined text message (specified with <text>). In Airplane mode, the RF interface of the ME is shut down to prevent it from unintentionally logging into the GSM network. All AT com­mands whose execution requires a radio connection are disabled. A list of AT commands supported during Airplane mode can be found in Section 23.4, Availability of AT Commands Depending on Oper­ating Mode of ME. To return from Airplane mode to Normal mode use the AT^SCFG command and set the parameter <map> to "off". This immediately activates the RF interface and restores access to all AT com­mands. The URC "^SYSSTART" notifies the user that the ME has returned to Normal mode. Please note that setting an alarm with AT+CALA is one method to wake up into Airplane mode. The second approach is using the AT^SCFG command, parameter <mapos>. For further detail on Airplane mode refer to Section 2.14, AT^SCFG.
The AT+CALA test command returns the supported array index values <n>, the supported alarm types <type> and the maximum length of the text <tlength> to be output.
The AT+CALA read command returns the current alarm settings in the ME.
Syntax
Test Command  
Response(s)
+CALA: (list of supported<n>s), (list of supported<type>s), (list of supported<tlength>s)
Read Command  
Response(s)
Write Command  
Response(s)
Reference(s) 
PIN 
ASC0 
ASC1 
USB 
MUX1 
MUX2 
MUX3 
Charge 
Last 
GSM 07.07

Unsolicited Result Code
+CALA: [<text>]
Indicates reminder message.

After power-down and wake-up at the scheduled time, the following URC indicates that the ME has entered the Airplane mode:
"^SYSSTART AIRPLANE MODE"
+CALA: [<text>]

Parameter Description
 
<time>(str)
Format is "yy/MM/dd,hh:mm:ss". For example, 6th of July 2005, 22:10:00 equals to "05/07/06,22:10:00" (see also AT+CCLK).
Note: If <time> equals current date and time or is set to an earlier date, TA returns +CME ERROR: 21.
To clear a given alarm before its scheduled time simply enter an empty string for parameter <time>. See exam­ples below.
 
<n>(num)
Integer type value indicating the array index of the alarm.
The ME allows to set only one alarm at a time. Therefore, the list of supported alarm events indicated by the test command AT+CALA=? is <n>=0. If a second alarm time is set, the previous alarm will be deleted. Therefore, the read command AT+CALA? will always return <n>=0. This is also true if individual settings are made on ASC0 and ASC1 or the various Multiplexer channels, for details see notes below.
 
<type>(num)
Integer type value indicating the type of the alarm.
0
Alarm indication: text message via serial interface
 
<text>(str)
String type value indicating the text to be displayed when alarm time is reached; maximum length is <tlength>. By factory default, <text> is undefined.
Note: <text> will be stored to the non-volatile flash memory when the device enters the Power Down mode via AT^SMSO. Once saved, it will be available upon next power-up, until you overwrite it by typing another text. This eliminates the need to enter the full string when setting a fresh alarm.
<text> should not contain characters which are coded differently in ASCII and GSM (e.g. umlauts), see also "Supported character sets" and "GSM alphabet tables".
 
Integer type value indicating the maximum length of <text>. The maximum length is 16.


Notes
•
After the alarm was executed the parameter <time> of AT+CALA will be reset to "00/01/01,00:00:00", but <text> will be preserved as described above.
•
•
Each time TC65 is restarted with ignition it takes 2s to re-initialize the RTC and to update the current time. Therefore, it is recommended to wait 2s before using the commands AT+CCLK and AT+CALA (for example 2s after ^SYSSTART has been output).
 
•
-
On each interface an individual <text> message can be stored, but only one time setting applies. This means an alarm <time> set on one of the interfaces overwrites the time setting on all remaining inter­faces. Therefore, the total number of alarm events returned by the read command AT+CALA? will always be <n>=0, no matter whether different text messages are stored.
-
When the scheduled alarm occurs, the ME sends the URC only on the interface where the most recent alarm setting was made. The alarm time will be reset to "00/01/01,00:00:00" on all interfaces.

Examples

EXAMPLE 1


You may want to configure a reminder message for July 31, 2005, at 9.30h, including the message "Good Morning".
 
Do not switch off the GSM engine.When the alarm occurs the ME returns the following URC:
 
EXAMPLE 2


To set a fresh alarm using the same message as in Example 1, simply enter date and time. <n>, <type>, <text>, <tlength> can be omitted:
 
When the alarm is executed the URC comes with the same message:
 
EXAMPLE 3


To enable the ME to wake up into Airplane mode, e.g. on July 20, 2005, at 8.30h, enter
 
Next, power down the ME:
 
When the alarm is executed the ME wakes up to Airplane mode and displays a URC. If available, this line is followed by the individual <text> most recently saved. If no individual message was saved only the first line appears.
 
EXAMPLE 4


To delete an alarm before its scheduled time is reached enter an empty string for parameter <time>. This will restore the default time and clear any individual message defined with <text>.